package com.ceshiren.chnjx.wework.page;

import com.ceshiren.chnjx.wework.page.contact.ContactPage;
import com.ceshiren.chnjx.wework.page.message.MessageManagerPage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

/**
 * @author: JJJJ
 * @date:2021/11/2 16:36
 * @Description: TODO
 */
public class MainPage extends BasePage {
    private By contactBtn = new By.ByLinkText("通讯录");
    private By sendMessageBtn = new By.ByLinkText("消息群发");

    public MainPage(WebDriver driver){
        super(driver);
    }

    public MainPage(){

    }

    /**
     * 进入通讯类页面
     */
    public ContactPage intoContactPage() {
        clickElement(contactBtn);
        return new ContactPage(driver);
    }

    /**
     * 退出驱动
     */
    public void teardown(){
        driver.quit();
    }

    public MessageManagerPage intoSendMessagePage(){
        clickElement(sendMessageBtn);
        return new MessageManagerPage(driver);
    }
}
